﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.master" AutoEventWireup="true" CodeFile="member_rent_create.aspx.cs" Inherits="member_rent_create" %>

<%@ Register Src="UserControl/MemberMenu.ascx" TagName="MemberMenu" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <link href="css/NewCss.css" rel="stylesheet" type="text/css" />
    <script src="Scripts/jquery.twzipcode-1.6.0.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(init);

        //網頁上所有的DOM都載入後
        function init() {
            $('#zip1').twzipcode({
                onCountySelect: function () {
                    setTxtValue($(this), 'ctl00_ContentPlaceHolder2_txtCity');
                },
                onDistrictSelect: function () {
                    setTxtValue($(this), 'ctl00_ContentPlaceHolder2_txtArea');
                },
                css: ['county', 'district', 'zip1']
            });

            setDdlValue('ctl00_ContentPlaceHolder2_txtCity', $('#zip1 .county option:selected'));
            setDdlValue('ctl00_ContentPlaceHolder2_txtArea', $('#zip1 .district option:selected'));
        }

        function setTxtValue(from, targetId) {
            var selectedText = $(from).find("option:selected").val();
            $("#" + targetId).val(selectedText);
        }

        function setDdlValue(fromId, target) {
            var txtValue = $("#" + fromId).val();
            $(target).text(txtValue);
        }
    </script>
    <style type="text/css">
        .zip1{display:none;}
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
<asp:panel runat="server" id="pnlUI">
<div id="All-Table">
  <div id="Title-Line">
    <h2>我的出租資訊-新增商店</h2>
  </div>
  <uc1:MemberMenu ID="memberMenu" runat="server" />
  <div id="Member2-PostLight"></div>
  <div id="Rent-Table">
    <div id="Member2-ChangePP"></div>
    <table border="0" cellpadding="0" cellspacing="0" id="Rant-Stable">
      <tr>
        <td width="27%" class="Rant-Sob01"><span class="Join-txt-red">★</span>出租商店名稱</td>
        <td width="73%" class="Rant-Sob02">
        <asp:TextBox ID="txtTitle" runat="server" CssClass="Join-Order" size="55"></asp:TextBox>     
        <asp:RequiredFieldValidator ID="RequiredFieldValidator21" runat="server" ErrorMessage="請輸入出租商店名稱"
                  ControlToValidate="txtTitle" Display="None" ValidationGroup="Save"></asp:RequiredFieldValidator>
        </td>
      </tr>
      <tr>
        <td class="Rant-Sob01"><span class="Join-txt-red">★</span>出租地址</td>
        <td class="Rant-Sob02">
        <div id="zip1"></div>
          <div style="padding-top:5px;"><asp:TextBox ID="txtRoad" runat="server" CssClass="Join-Order" size="55"></asp:TextBox></div>
          <asp:TextBox ID="txtCity" runat="server" Style="display:none;"></asp:TextBox>
          <asp:TextBox ID="txtArea" runat="server" Style="display:none;"></asp:TextBox>        
          <asp:RequiredFieldValidator ID="RequiredFieldValidator25" runat="server" ErrorMessage="請輸入出租地址"
                  ControlToValidate="txtRoad" Display="None" ValidationGroup="Save"></asp:RequiredFieldValidator>
        </td>
      </tr>
      <tr>
        <td class="Rant-Sob01"><span class="Join-txt-red">★</span>聯絡人</td>
        <td class="Rant-Sob02">
        <asp:TextBox ID="txtCustomField4" runat="server" CssClass="Join-Order" size="55"></asp:TextBox>     
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="請輸入聯絡人"
                  ControlToValidate="txtCustomField4" Display="None" ValidationGroup="Save"></asp:RequiredFieldValidator>
        </td>
      </tr>
      <tr>
        <td class="Rant-Sob01">　聯絡電話</td>
        <td class="Rant-Sob02">
        <asp:TextBox ID="txtCustomField5" runat="server" CssClass="Join-Order" size="55"></asp:TextBox>
        <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ValidationGroup="Save" ErrorMessage="連絡電話格式錯誤"
                  Display="None" ValidationExpression="^\(?\d{2}\)?[\s\-]?\d{4}\-?\d{4}$" ControlToValidate="txtCustomField5"></asp:RegularExpressionValidator>
        </td>
      </tr>
      <tr>
        <td class="Rant-Sob01"><span class="Join-txt-red">★</span>手機</td>
        <td class="Rant-Sob02">
        <asp:TextBox ID="txtCustomField6" runat="server" CssClass="Join-Order" size="55"></asp:TextBox>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="請輸入手機"
                  ControlToValidate="txtCustomField6" Display="None" ValidationGroup="Save"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator5" runat="server" ValidationGroup="Save" ErrorMessage="手機格式錯誤"
                  Display="None" ValidationExpression="^(09)([0-9]{8})$" ControlToValidate="txtCustomField6"></asp:RegularExpressionValidator>
        </td>
      </tr>
      <tr>
        <td class="Rant-Sob01"><span class="Join-txt-red">★</span>E-mail</td>
        <td class="Rant-Sob02">
        <asp:TextBox ID="txtCustomField7" runat="server" CssClass="Join-Order" size="55"></asp:TextBox>
      <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="請輸入E-mail"
                  ControlToValidate="txtCustomField7" Display="None" ValidationGroup="Save"></asp:RequiredFieldValidator>      
      <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ValidationGroup="Save" ErrorMessage="E-mail(會員帳號)格式不正確"
                  Display="None" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ControlToValidate="txtCustomField7"></asp:RegularExpressionValidator>
        </td>
      </tr>
      <tr>
        <td class="Rant-Sob01">　統編</td>
        <td class="Rant-Sob02"><asp:TextBox ID="txtCustomField8" runat="server" CssClass="Join-Order" size="55"></asp:TextBox></td>
      </tr>
      <tr>
        <td class="Rant-Sob01"><span class="Join-txt-red">★</span>房屋自有或承租</td>
        <td class="Rant-Sob02">
            <asp:RadioButtonList ID="rdoCustomField9" runat="server" RepeatDirection="Horizontal">
            <asp:ListItem Value="自有"></asp:ListItem>
            <asp:ListItem Value="承租"></asp:ListItem>
            </asp:RadioButtonList>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="請選擇房屋自有或承租"
                  ControlToValidate="rdoCustomField9" Display="None" ValidationGroup="Save"></asp:RequiredFieldValidator>
        </td>
      </tr>
      <tr>
        <td class="Rant-Sob01">　備註</td>
        <td class="Rant-Sob02">
        <asp:TextBox ID="txtNote" runat="server" CssClass="Join-Order2" size="55" Width="350px" TextMode="MultiLine"></asp:TextBox>
        </td>
      </tr>
      <tr>
        <td class="Rant-Sob01">　照片上傳</td>
        <td class="Rant-Sob02">
        <asp:Literal ID="ltlImg" runat="server"></asp:Literal>
        <asp:FileUpload ID="FileUpload1" runat="server" accept="png|jpg" class="multi" maxlength="1" />
          <asp:Button ID="btnUpliad" runat="server" Text="確定上傳" 
                                        onclick="btnUpliad_Click" CssClass="order02" CausesValidation="false" />
          </td>
      </tr>
      <tr>
        <td height="36" class="Rant-Sob01">&nbsp;</td>
        <td valign="bottom" class="Rant-Sob02">
        <a href="member_rent.aspx"><div class="Btn-New1">放棄編輯</div></a>
          <asp:LinkButton ID="btnSave" runat="server" onclick="btnSave_Click" ValidationGroup="Save" ><div class="Btn-New1">確定送出</div></asp:LinkButton>          
        </td>
      </tr>
    </table>
</div>
  <img src="image/member-detial2.png" width="971" height="39" /> </div>
  <asp:ValidationSummary ID="ValidationSummary1" runat="server" ValidationGroup="Save" 
        ShowMessageBox="True" ShowSummary="False"/>
</asp:panel>
</asp:Content>

